1. Field of the Invention
The present invention relates to an apparatus for producing dot data or dot-matrix data from outline data defining one or more outlines of a character.
2. Related Art Statement
There is known a data processing device which processes outline data including a plurality of sets of point data, i.e., sets of x and y coordinates which cooperate with each other to define, in the x-y coordinate system, one or more outlines of a character (e.g., letter, numeral, symbol, figure, etc.). The data processing device produces dot-matrix data from the outline data, so that an output device such as a printer or an image display outputs the character according to the dot-matrix data. The dot-matrix data include (a) a plurality of sets of "ON" data (or "OFF" data) defining the inside area of the output character and (b) a plurality of sets of "OFF" data (or "ON" data) defining the outside area of the output character. Each set of "ON" or "OFF" data corresponds to a unit area of the x-y coordinate system or plane, on one hand, and corresponds to a picture element of the output character, on the other hand.
The process of producing dot-matrix data from outline data may easily be understood by assuming a picture-element screen 24, as shown in FIG. 3, which conceptionally defines the picture elements of an output character to be produced by the output device. The picture-element screen 24 is constituted by (a) a number of straight lines extending parallel to a Y axis and passing through respective integral coordinates of an X axis which is perpendicular to the Y axis and cooperates with the Y axis to provide a two-dimensional coordinate system, and (b) a number of straight lines extending parallel to the X axis and passing through respective integral coordinates of the Y axis. In this case, each picture element of the output character corresponds to a square unit area defined by (a) two adjacent straight lines parallel to the Y axis and (b) two adjacent straight lines parallel to the X axis, and those four straight lines provide the four boundary lines of the square unit area.
A raster-scanning method using a picture-element screen is used for producing dot-matrix data from outline data. This method will be described in detail by reference to the outline data of a character "H" shown in FIG. 17. First, the outline data, or outline defined thereby, are assumed to be superposed on a picture-element screen. Next, a single straight scanning line is assumed to extend parallel to the X or Y axis and pass through the centers of square unit areas of the picture-element screen, i.e., picture elements of an output character. Subsequently, all the intersecting point or points of the scanning line and the character outline is/are determined. Based on the position or positions of the intersecting point or points, a set of "ON" or "OFF" data is produced for each of the square unit areas currently under the scanning line, according to a predetermined rule, so that one or more sets of "ON" data substantially define the inside area of the character outline and one or more sets of "OFF" data substantially define the outside area of the character outline. The predetermined rule may be such that if the center of each square unit area falls within the inside area of the character outline, that unit area is defined by a set of "ON" data and, if not, that unit area is defined by a set of "OFF" data. Thus, one raw or one column of the dot-matrix data is produced. By repeating this operation moving the scanning line all over the picture-element screen in a direction parallel to the Y or X axis, the entire dot-matrix data are produced for the character as a whole. In this way, the dot-matrix data are produced from the outline data.
Alternatively, after the original outline data have been transformed into transformed outline data defining a transformed outline having a changed size, the transformed outline data may be converted into dot-matrix data in the same manner as described above. In this case, it is possible to produce various sizes of transformed outlines or output characters from a single set of original outline data. Since outline data are more compact than dot-matrix data, a number of sets of outline data for a number of characters are advantageously stored in a memory of a smaller storage capacity. The process of changing the size of an original outline or character defined by original outline data will be described by reference to the outline data of character "H" of FIG. 17. This process may be performed by transforming the sets of point data, i.e., sets of x and y coordinates of the original outline data in such a way that each of the picture elements of an output character corresponds to a square unit area whose four vertices are defined by two adjacent transformed x integral coordinates and two adjacent transformed y integral coordinates.
Assuming that a desired size of the output character be selected at a value, p (points; p=1 is equal to 1/72 inch), by an operator or user through an input device such as a keyboard, that the picture-element resolution of the output device be specified at a value, d (dots per inch), and that the original size of the character be defined at a value, e, by the original outline data, then a transformation coefficient, Z, for the above coordinate transformation is obtained by the following expression: EQU Z=(p.times.d)/(I.times.e)
where
I is a constant, i.e., 72 (points per inch). PA1 Z is the transformation coefficient with respect to the X and/or Y axis; PA1 T is the parallel-translation amount with respect to the X and/or Y axis; PA1 v is each of the x and/or y coordinates of the original outline data; and PA1 v' is a corresponding one of the x and/or y coordinates of the transformed outline data.
In the case where the picture-element resolution d is equal to the constant I, i.e., 72, the above expression becomes more simple: Z=p/e. The transformation coefficient defines a scale of the output character.
Additionally, the operator may input, through the input device, data indicative of a desired position of the output character, i.e., parallel-translation amount of the output character with respect to the X and/or Y axis. Therefore, this coordinate transformation is generally expressed by the following transformation function, i.e., linear function: EQU v'=Z.times.v+T
where
Hereinafter, the original outline data are referred to as the "outline data A" and the transformed outline data are referred to as the "outline data B".
If the outline data B are superposed on a picture-element screen 124 as shown in FIG. 18, and subsequently the outline data B are subjected to the raster-scanning method to produce dot-matrix data, the dot-matrix data produced may suffer low quality because quantization errors may occur when the outline data B are converted into the dot-matrix data. Assuming that each of two vertical strokes 21, 22 of the original character "H" of FIG. 17 have an original width of 14 (=Ww1 or Ww2) and that the original outline be transformed according to a scale (=p/e) of 1/10, the prior data processing device produces, from the outline data B, the dot-matrix data including sets of "ON" data indicated by hatching in FIG. 18, by the raster-scanning method, in the case where the resolution d is equal to the constant I. As can been seen from FIG. 18, the two vertical strokes of a dot image defined by the dot-matrix data have different widths (i.e., two-dot width and one-dot width) whereas the two counterparts of the transformed outline defined by the outline data B have the same width (=1.4). Thus, the dot image, i.e., output character may give a strange impression to observers.
For solving the above problem, it has been practiced to automatically adjust the width of a vertical or horizontal stroke of a transformed outline, i.e., distance between the two opposed outline segments of the vertical or horizontal stroke, and thereby control the number of picture elements to be located between the two outline segments of the vertical or horizontal stroke. One of the known methods will be described below.
First, line-spacing data are prepared which include (a) point data including two x or y coordinates defining a vertical or horizontal stroke to be adjusted and (b) spacing data defining the distance between the two coordinates. However, the preparation of (b) the spacing data may not be necessary, because the spacing data may be automatically produced from (a) the position data. 10 Additionally, in the case where (b) the spacing data are prepared, (a) the position data may consist of only one x or y coordinate. In either case, the line-spacing data provide original width data defining the original width of the vertical or horizontal stroke. A set of x line-spacing data for a vertical stroke may include (a) x position data including two x coordinates and (b) x spacing data defining the distance between the two x coordinates. Similarly, a set of y line-spacing data for a horizontal stroke may include (c) y position data including two y coordinates and (d) y spacing data defining the distance between the two y coordinates. FIG. 17 shows the outline data A of character "H" for which two sets of x line-spacing data have been prepared for the two vertical strokes 21, 22 and one set of y line-spacing data has been prepared for a horizontal stroke 23.
Second, the line-spacing data are transformed according to a desired size p of the output character. Regarding the character "H" of FIG. 17, the two x coordinates of each of the two sets of x line-spacing data 21, 22 are transformed by the same manner as used for the coordinate transformation of the outline data A into the outline data B, and the distance or width defined by the x spacing data of each set of x line-spacing data 21, 22 is multiplied by the transformation coefficient Z, and then is rounded by counting fractions of 0.5 and over as one and cutting away the rest, or otherwise cutting away all 10 fractions smaller than one. The thus obtained width will be referred to as the "dot width". The dot width corresponds to an integral number of dots, i.e., picture elements of the output character.
Third, the transformed line-spacing data are corrected according to the flow chart of FIG. 20. Initially, at Step S51, one of the two transformed coordinates of each transformed set of x or y line-spacing data which one transformed coordinate has a smaller distance up to an x or y integral coordinate nearest thereto than that of the other transformed coordinate, is selected as a base coordinate, and the other transformed coordinate is selected as a dependent coordinate. At Step S52, the base coordinate is moved, i.e., rounded to that integral coordinate nearest thereto, which provides a corrected base coordinate. Otherwise, a smaller one of the two transformed coordinates may be selected as a base coordinate and be rounded to an integral coordinate as a corrected base coordinate by cutting away all fractions smaller than one. Then, at Step S53, a dot width for the two transformed coordinates is determined as described above. Subsequently, at Step S54, all the x or y coordinates of the outline data B equal to the base coordinate are corrected or moved to the corrected base coordinate, and at Step S55 all the x or y coordinates of the outline data B equal to the dependent coordinate are corrected or moved to an integral x or y coordinate distant from the corrected base coordinate by the dot width.
Supposing that a set of line-spacing data be expressed by three values, (coordinate 1, coordinate 2, width value), the original outline A of character "H" of FIG. 17 include the set of x line-spacing data, (W11, W12, Ww1), for the vertical stroke 21; the set of x line-spacing data, (W21, W22, Ww2), for the vertical stroke 22; and the set of y line-spacing data, (U11, U12, Uw1), for the horizontal stroke 23. The values W11, W12, W21, W22 are x coordinates; the values U11, U12 are y coordinates; and all the width values Ww1, Ww2, Uw1 are equal to 14.
FIG. 19 shows outline data C obtained by correcting the outline data B as described above. Reference numeral 41 designates the transformed outline defined by the outline data B, and numeral 42 designates a corrected outline defined by the outline data C. For example, regarding the transformed set of x line-spacing data, (W11a, W12a, Ww1a), for the vertical stroke 21, one transformed x coordinate W11a that is nearer to an x integral coordinate, wb, nearest thereto than the other transformed x coordinate W12a, the value W11a is selected as the base coordinate and the value W12a is selected as the dependent coordinate, at Step S51 of FIG. 20. At the following Step S52, the x integral coordinate wb nearest to the base coordinate W11a is determined as the corrected base coordinate. Subsequently, at Step S53, a dot width is determined by rounding the transformed width value Ww1a, i.e., counting fractions of 0.5 and over as one and cutting away the rest. Since the original width value Ww1=14 is reduced according to the scale (=p/e) of 1/10 and the resolution d is equal to the constant I, the transformed width value Ww1a is equal to 1.4, therefore it is rounded to 1. At Step S54, all the transformed x coordinates of the outline data B equal to the base coordinate W11a are corrected or moved to the corrected base coordinate, i.e., x integral coordinate wb. Subsequently, at Step S55, all the transformed x coordinates of the outline data B equal to the dependent coordinate W12a are corrected or moved to an x integral coordinate, wb+1. Thus, the correction of the transformed set of x line-spacing data for the vertical stroke 21 is ended. Similarly, the set of x line-spacing data for the vertical stroke 22 and the transformed set of y line-spacing data for the horizontal stroke 23 are corrected. The two vertical strokes and one horizontal stroke of the corrected outline 42 defined by the outline data C have the same dot with, so that the dot-matrix data produced from the outline data C enjoy high quality and the output character produced according to the dot-matrix data gives a good impression to observers.
However, the above-described prior data processing method suffer from a problem that a small difference of the respective original widths of two strokes of a character may be amplified into the difference of one dot, i.e., one picture element of an output character. This may lead to lowering the quality of the output character in particular in the case where a selected size p of the output character is small and/or the picture-element resolution d of the output character is low, because in those cases the ratio of one picture element relative to the whole output character is great. For example, assuming that a horizontal stroke 61 of a character "F" of FIG. 2 have the original width of 15 and each of a horizontal stroke 62 and a vertical stroke 63 of the same have the original width of 14, the original outline data of character "F" are converted into dot-matrix data indicated by hatching in FIG. 21, under the same conditions as described above for the conversion of the original outline data of character "H" of FIG. 17.
In the prior method, the difference, one, between the original width values, 15 and 14, of the horizontal stroke 61 and the horizontal stroke 62 or vertical stroke 63 is amplified into the difference of one picture element of an output character 72 via a transformed outline 71. Thus, the output character suffers low quality. On the other hand, in the case where a selected size p of the output character is large and/or the picture-element resolution d of the output character is high, the ratio of one picture element relative to the whole output character is small. In the latter case, the output character effectively reflects the original small difference between the stroke width values, thereby enjoying a good visual balance between the two or more strokes. Thus, the original small difference between the stroke width values should not be eliminated from the original outline data.